<?php 
error_reporting(E_ERROR | E_PARSE);
include_once('connection/connection.php');
include('header.php');
include('menu.php');
include('config.php');
function getName($colName,$id)
{
	//$arrColName=explode('_',$colName);
	//$colNameText=$arrColName[0]."_name";
	$sqlgetName="select distinct ".$colName."_name from tbl_lookup_location where ".$colName."_id=".$id;
	$querygetName=mysql_query($sqlgetName);
	$rowgetName=mysql_fetch_row($querygetName);
	return $rowgetName[0];
}
if(isset($_POST['submit']))
{ 
	$district=$_POST['district'];
	$_SESSION['district']=$district;
	header('Location: ufw_report.php');
}	
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>RWSS Report</title>
</head>
<body>
<div align="center">
<form action="" method="post" enctype="multipart/form-data" onSubmit="return validate()" name="view_main_q1">
	<table border="0" width="746" id="table1" cellspacing="0" cellpadding="0" style="padding:10px;">
	<tr bgcolor="#C5D8EB">
		<td height="29" align="center" valign="center"  colspan="5"><font face="Arial" style="font-size: 8.5pt" color="#006699"><b>District wise RWSS Report</b></font></td>
	</tr>
	
	
	<tr>
	  <td align="right" colspan="3">&nbsp;</td>
	  <td colspan="2" align="left">&nbsp;</td>
	  </tr>
	<tr>
		<td height="37" colspan="3" align="right"><font face="Verdana" color="#000000" style="font-size: 8.5pt">Select District&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font></td>
	    <td align="left" width="24%">
			<select name="district" id="district" style="font-size:12px; padding:5px;">
			<option value="">Select District</option>
			<?php
			//$qry="select DISTINCT district from tbl_dtls_ufw_src_village order by district";
			$qry="select DISTINCT multi_dist_id from tbl_dtls_ufw_main";
			//echo $qry;
			$result=mysql_query($qry);
			while(list($id)=mysql_fetch_array($result))
			{
    			?><option value="<?php echo $id ?>" <?php //if($id=='418'){echo 'selected';} ?>><?php echo getName('district',$id) ?></option>
			<?php } ?>
			</select>	  </td>
	    <td align="left" width="43%"><input type="submit" value="View" name="submit" style="border:1px solid #000000; font-size: 8pt; font-family: Verdana; " onClick="view_validate()"></td>
	</tr>
	<tr><td colspan="5">&nbsp;</td></tr>
	<tr><td colspan="5">&nbsp;</td></tr>
	<tr><td colspan="5">&nbsp;</td></tr>
	<tr>
		<td colspan="5">
			<p align="center">&nbsp;
			</p>		</td>
	</tr>
</table>	
</body>
</html>
